/*
	MIDAS Context Based Routing
	cbr_rreqtable.h
	Copyright (c) 2007 Radoslaw Olgierd Schoeneich
	Copyright (c) 2007 Bartlomiej Zolnierkiewicz
	MEAG IT PW
*/

#ifndef cbr_rreqtable_h_
#define cbr_rreqtable_h_

#include <map>

#include "cbr_types.h"

/**
 * RREQ Table.
 */

class cbr_RReqTable : private cbr_Object {
private:
	struct entry {
		u_int32_t	trID;
		cbr_ID		src;
		cbr_ID		prev_hop;

		entry(u_int32_t t, cbr_ID s, cbr_ID ph)
			: trID(t), src(s), prev_hop (ph) { }
	};

	typedef std::list<entry> reqs_list;
	reqs_list reqs;

public:
	cbr_RReqTable();
	~cbr_RReqTable();

	void		insert(u_int32_t trID, cbr_ID src, cbr_ID prev_hop);
	void		remove(u_int32_t trID, cbr_ID src);
	bool		getPrevHop(u_int32_t trID, cbr_ID src, cbr_ID *prev_hop);
};


#endif	// cbr_rreqtable_h_
